<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="<?php echo base_url('public_source/javascript/jquery-1.9.1.js')?>" type="text/javascript"></script>  
        <title></title>
        <link rel="icon" type="image/png" href="<?php base_url("public_source/images_source/icon_web.png") ?>">
        <meta name="keyword" content="hitechstore">
        <meta name="description" content="HitechStore.com - Chuyên bán laptop, phụ kiện và các thiết bị kỹ thuật số ">
    </head>
    <script>
        $(document).ready(function(){
            $(".xoa").click(function(){
                $.ajax({
                        type: "POST",
                        url: "<?php echo site_url('home/my_like');?>",
                        data: {id : $(this).attr("href"), uri : $(this).attr("id")},
                        async: false,
                        beforeSend: function(){
                                $("#ajax_change").html(""); 
                        },
                        success: function(kq){
                                $("#ajax_change").html(kq);
                        }
                    });
                        return false;
                    });	
                    $("#jquery_link a").click(function(){
                    var url = $(this).attr("href");
                    $.ajax({
                            type: "POST",
                            url: url,
                            data: "ajax=aaa",
                            async: true,
                            beforeSend: function(){
                                    $("#ajax_change").html("");
                            },
                            success: function(kq){
                                    $("#ajax_change").html(kq);
                            }
                    });
                    return false;
                    });		
                    });
    </script>
    <style>
                .Buy_Button{height: 22px; width: 90px; color: #333; cursor: pointer; padding-left: 25px; padding-top: 4px; font-size: 12px; margin-top: 10px; font-weight: bold; margin-left: 30px; background-image: url(<?php echo base_url("public_source/images_source/dathang.gif")?>); background-repeat: no-repeat}

            .Button {text-decoration: none}
            </style>
    <body>
        
        <div id="ajax_change">
            <table id="detail_table" cellspacing="10px">
                <?php 
                    if ($sp != 0)
                    {
                        foreach ($sp as $item)
                        {
                                echo "<tr>";
                                echo '<td><a href=""><img width="150px" height="130px" src="'.base_url($item->hinh).'"></a></td>';
                                echo '<td>';
                                echo '<div style="margin-left: 10px; width: 320px; height:130px">';
                                echo '<a style="font-weight: normal; font-size: 20px" href="">'.$item->ten.'</a>';
                                echo '<div style="margin-top: 10px; font-weight: normal; font-size: 14px"><strong>Thành tiền: '.number_format($item->gia,0,'.','.').' VNĐ</strong></div>';
                                echo '<a class="Button" href="'.site_url("home/update_my_cart").'?id='.$item->id.'&name='.$item->ten.'&cost='.$item->gia.'&url='.$item->hinh.'"><div class="Buy_Button">Mua hàng</div></a>';
                                echo '</div>';
                                echo '</td>';
                                echo '<td><a style="color: red" class="xoa" id="'.$uri.'" href="'.$item->id.'">xóa</a></td>';
                                echo "</tr>";
                        }
                    
                ?>
                <tr>
                    <td>
                        Tiếp tục mua sắm <a style='color: blue' href='<?php echo site_url("home/index"); ?>'>Tại đây</a>
                    </td>
                </tr>
                    <?php }else{
                        echo "<tr>";
                        echo "<td>";
                        echo "Hiện không có sản phẩm nào trong giỏ hàng yêu thích của bạn. Tiếp tục mua sắm "."<a style='color: blue' href='".site_url("home/index")."'>Tại đây</a>";
                        echo "</td>";
                        echo "</tr>";
                    } ?>
            </table>
            <div id="jquery_link" align="center" style="width: 98%; background-color: #eee; padding: 5px">
                <?php echo $pagination;?>
            </div>
        </div>
    </body>
</html>